//
//  WmcCloudSynSettingView.swift
//  YPWatermarkCamera
//
//  Created by yupao_ios_macmini06 on 2022/9/27.
//

import UIKit

class WmcCloudSynSettingView: WmcBaseView {

    override func makeUI() {
        
        addSubview(topLineView)
        addSubview(titleLabel)
        addSubview(subTitleLabel)
        addSubview(switchView)
        addSubview(coverButton)
        
        topLineView.snp.makeConstraints { make in
            make.top.equalToSuperview()
            make.left.right.equalToSuperview()
            make.height.equalTo(1)
        }
        
        titleLabel.snp.makeConstraints { make in
            make.top.equalTo(topLineView.snp.bottom).offset(16)
            make.height.greaterThanOrEqualTo(21)
            make.left.equalTo(16)
        }
        
        subTitleLabel.snp.makeConstraints { make in
            make.top.equalTo(titleLabel.snp.bottom).offset(8)
            make.left.equalTo(16)
            make.height.greaterThanOrEqualTo(18)
            make.bottom.equalTo(-8)
        }
        
        switchView.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.right.equalTo(-16)
            make.width.equalTo(50)
            make.height.equalTo(26)
        }
        
        coverButton.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.right.equalTo(-16)
            make.width.equalTo(50)
            make.height.equalTo(26)
        }
    }
    
    func configure(synStatus: Bool) -> Void {
        self.switchView.isOn = synStatus
    }
    
    lazy var topLineView: UIView = {
        let view = UIView()
        view.backgroundColor = UIColor.wmc_grayH15_E6E6E6
        return view
    }()
    
    lazy var titleLabel: UILabel = {
        let view = UILabel()
        view.textColor = UIColor.wmc_grayH2_323233
        view.font = 17.yp.uiFont(weight: .semibold)
        view.text = "拍照自动同步至个人云相册"
        return view
    }()
    
    lazy var subTitleLabel: UILabel = {
        let view = UILabel()
        view.textColor = UIColor.wmc_grayH8_8A8A99
        view.font = 14.yp.uiFont
        view.text = "开启拍照自动同步，照片永不丢失"
        return view
    }()
    
    lazy var switchView: UISwitch = {
        let view = UISwitch()
        view.onTintColor = UIColor.wmc_mainTheme
        view.setOn(true, animated: false)
        return view
    }()
    
    lazy var coverButton: UIButton = {
        let view = UIButton()
        return view
    }()
}
